/*
*/

package rosas.lou.weatherclasses;

import java.util.*;
import java.lang.*;
import rosas.lou.weatherclasses.*;
import gnu.io.*;

import com.dalsemi.onewire.*;
import com.dalsemi.onewire.adapter.*;
import com.dalsemi.onewire.container.*;

public class Thermometer extends Sensor{
   private static String sensortype1 = new String("DS18S20");
   private static String sensortype2 = new String("DS1920");
   private static final double DEFAULT_TEMP = -999.9;

   private OneWireContainer10 tempDevice;

   private double temperature;
   private Units  units;
   private String name; //DS18S10 or DS1920
   private String id;
   private String type;

   //*********************Constructors*******************************
   /*
   Constructor of taking in the port data so as to find the
   appropriate sensor and id
   */
   public Thermometer(Stack sensorStack){
      this.tempDevice = null;
      this.setUnits(Units.METRIC); //Default the Units to metric
      this.setType("Thermometer");
      this.setUpSensorDevice(sensorStack);
   }

   //********************Public Methods******************************
   /*
   */
   public String getID(){
      return this.id;
   }

   /*
   */
   public String getName(){
      return this.name;
   }

   /*
   */
   public Units getUnits(){
      return this.units;
   }

   /*
   */
   public String getType(){
      return this.type;
   }

   /*
   From the OneWireContainer10 instance, read the sensor hardware
   for the thermometer.  Set the appropriate units, and return the
   measurement data in those units
   */
   public double measure(Units units){
      this.setUnits(units);
      return -1.;  //Temporary "fix" for now
   }

   /*
   Measure the temperature and return in the current units
   */
   public double measure(){
      return -1.;  //Temporary "fix" for now
   }
   
   //********************Private Methods*****************************
   /*
   */
   private void setType(String name){
      this.type = new String(name);
   }

   /*
   */
   private void setUnits(Units units){
      this.units = units;
   }

   /*
   */
   private void setUpSensorDevice(Stack sensorStack){
   }
}
